/**
 * Description:
 * Class Name:ITCDepositThread
 * Date:2022/5/7 16:47
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第16章_多线程._16_6_线程间通信._16_6_1_传统的线程通信;

public class ITCDepositThread extends Thread{
    private ITCAccount account;
    private double depositAmount;
    public ITCDepositThread(String name, ITCAccount account, double depositAmount){
        super(name);
        this.account = account;
        this.depositAmount = depositAmount;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            account.deposit(depositAmount);
        }
    }
}
